namespace NewsSystem.Data.Migrations
{
    using NewsSystem.Models;
    using System;
    using System.Data.Entity.Migrations;

    public class Configuration : DbMigrationsConfiguration<NewsSystem.Data.NewsContext>
    {
        public Configuration()
        {
            this.AutomaticMigrationsEnabled = true;
            this.AutomaticMigrationDataLossAllowed = true;
        }

        protected override void Seed(NewsSystem.Data.NewsContext context)
        {
            //  This method will be called after migrating to the latest version.
            //  You can use the DbSet<T>.AddOrUpdate() helper extension method 
            //  to avoid creating duplicate seed data. E.g.
            //
            //    context.People.AddOrUpdate(
            //      p => p.FullName,
            //      new Person { FullName = "Andrew Peters" },
            //      new Person { FullName = "Brice Lambson" },
            //      new Person { FullName = "Rowan Miller" }
            //    );
            //
            context.Users.AddOrUpdate(u => u.NickName, new User
            {
                Email = "abv.bg",
                ExpireDate = DateTime.Now.AddDays(4444),
                NickName = "God",
                PasswordHashed = "123456",
                SessionId = "111"
            });
        }
    }
}